

use "ipums 2012 census sample.dta", clear

********************
***   Cleaning   ***
********************


* Location

quietly {
	decode geo1_zw2012, gen(province)
	replace province = proper(province)

	decode geo2_zw2012, gen(district)
	replace district = proper(district)

	gen urban = 0 if district != ""
	replace urban = 1 if strpos(district, "Urban") > 0
	replace urban = 1 if province == "Harare"
	replace urban = 1 if district == "Chiredzi Town"
	replace urban = 1 if district == "Redcliff"
	replace urban = 1 if district == "Norton"
	replace urban = 1 if district == "Victoria Falls"


	replace district = subinstr(district, " Rural", "", .)
	replace district = subinstr(district, "Chiredzi Town", "Chiredzi", .)
	replace district = "Mount Darwin" if district == "Mt Darwin"
	replace district = "Mangwe" if strpos(district, "Mangwe") > 0
	replace district = "Mazowe" if strpos(district, "Mazowe") > 0
	replace district = "Hurungwe" if strpos(district, "Hurungwe") > 0
	replace district = "Chirumhanzu" if district == "Chirumanzu"
	replace district = "Centenary" if district == "Muzarabani"
	replace district = "Bulawayo" if district == "Bulawayo Urban"
	replace district = "Chinhoyi Urban" if district == "Chinhoyi"
	replace district = "Harare Urban" if district == "Harare"
	replace district = "Hwange" if district == "Hwange Urban"
	replace district = "Kadoma Urban" if district == "Kadoma"
	replace district = "Zvishavane" if district == "Zvishavane Urban"
	replace district = "Gokwe South Urban" if strpos(district, "Gokwe Centre") > 0
}

*******************
***   Merging   ***
*******************

quietly {
	ren district district_n
	ren province provnamefu

	merge m:1 provnamefu district_n using "rebel_control.dta"
	drop if _merge == 2

	ren district_n district
	ren provnamefu province

	order province district districtpc urban
	
	drop _merge
	merge m:1 districtpc using "shona_80pct.dta"
	gen shona_majority = 1 if _merge == 3
	/* merge == 2 are urban areas (Zvishavane town, chipinge urban) */
	drop _merge
}


***********************************
***   Clean data, create vars   ***
***********************************

quietly {
	keep if race == 20
	keep if nativity == 1
	keep if nation == 11180
	gen male = sex == 1

	* Education

	gen school = .
	replace school = 0 if educzw == 10
	replace school = 1 if educzw >= 21 & educzw <= 29
	replace school = 2 if educzw >= 31 & educzw <= 38
	replace school = 3 if educzw >= 41 & educzw <= 49
	replace school = 4 if educzw >= 51 & educzw <= 59
	
	gen school_full = .
	replace school_full = 0 if educzw <= 29
	replace school_full = educzw - 30 if educzw >= 31 & educzw <= 37
	replace school_full = educzw - 33 if educzw >= 41 & educzw <= 46
	replace school_full = 13 if educzw >= 51 & educzw <= 60
	
	gen school_full2 = .
	replace school_full2 = 0 if educzw <= 29
	replace school_full2 = educzw - 30 if educzw >= 31 & educzw <= 37
	replace school_full2 = educzw - 33 if educzw >= 41 & educzw <= 44
	replace school_full2 = 11 if educzw >= 45 & educzw <= 46
	replace school_full2 = 11 if educzw >= 51 & educzw <= 60

	gen inc_secondary = 0 if school != .
	replace inc_secondary = 1 if school >= 3 & school != . & school != 51

	gen year_birth = 2012-age if age != 999

	gen schooling1 = inc_primary
	replace schooling1 = 2 if primary == 1
	replace schooling1 = 3 if inc_secondary == 1

	gen schooling2 = inc_primary
	label var schooling2 "Education"
	replace schooling2 = 2 if primary == 1
	replace schooling2 = 3 if inc_secondary == 1
	replace schooling2 = 4 if secondary == 1
	
}


***********************
***   Create post   ***
***********************

quietly {
	
	gen sec_post = 0 if year_birth != .
	replace sec_post = 1 if year_birth >= 1969 & year_birth != .
	replace sec_post = 5/6 if year_birth == 1968 
	replace sec_post = 4/6 if year_birth == 1967 
	replace sec_post = 3/6 if year_birth == 1966
	replace sec_post = 2/6 if year_birth == 1965
	replace sec_post = 1/6 if year_birth == 1964

	
	gen sec_post2 = 0 if year_birth != .
	replace sec_post2 = 1 if year_birth >= 1967 & year_birth != .
	replace sec_post2 = 3/4 if year_birth == 1966
	replace sec_post2 = 2/4 if year_birth == 1965
	replace sec_post2 = 1/4 if year_birth == 1964

	gen sec_post3 = 0 if year_birth != .
	replace sec_post3 = 1 if year_birth >= 1969 & year_birth != .
	replace sec_post3 = . if year_birth >= 1960 & year_birth <= 1968
}


**********************************
***   Create rebel variables   ***
**********************************

gen zanu_control = zanu_pres
replace zanu_control = 0 if contestation != 0 & zanu_pres != .

gen zapu_control = zapu_pres
replace zapu_control = 0 if contestation != 0 & zapu_pres != .


****************************
***   MAIN REGRESSIONS   ***
****************************

est clear


quietly eststo: areg schooling1 c.zanu_control##c.sec_post c.contestation##c.sec_post i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)
summ schooling1 if urban == 0 & year_birth >= 1950 & year_birth <= 1971
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post if urban == 0 & year_birth >= 1950 & year_birth <= 1971
estadd scalar sd = r(sd)

test c.contestation#c.sec_post = c.zanu_control#c.sec_post

quietly eststo: areg schooling1 c.zanu_control##c.sec_post3 c.contestation##c.sec_post3 i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)
summ schooling1 if urban == 0 & year_birth >= 1950 & year_birth <= 1971
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post3 if urban == 0 & year_birth >= 1950 & year_birth <= 1971
estadd scalar sd = r(sd)

test c.contestation#c.sec_post3 = c.zanu_control#c.sec_post3

esttab est1 est2 ///
using "tables/zimbabwe main tables.tex", b(3) se(3) ar(3) ///
stats(N vmean sd, fmt(0 3 3 3 3 "")  ///
labels(`"Observations"' `"Dep Mean"' `"Indep SD"')) ///
star(* 0.1 ** 0.05 *** 0.01) ///
mtitles(`var') ///
keep(c.contestation#c.sec_post c.zanu_control#c.sec_post c.contestation#c.sec_post3 c.zanu_control#c.sec_post3) ///
title("Education" \label{tab:education}) style(tex) label append



*****************************
***   ROBUSTNESS CHECKS   ***
*****************************

est clear


* diff schooling 0-4
est clear
quietly eststo: areg schooling2 c.zanu_control##c.sec_post c.contestation##c.sec_post i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)
summ schooling2
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post
estadd scalar sd = r(sd)

quietly eststo: areg schooling2 c.zanu_control##c.sec_post3 c.contestation##c.sec_post3 i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)
summ schooling2
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post3
estadd scalar sd = r(sd)

esttab est1 est2 ///
using "tables/zimbabwe appendix tables.tex", b(3) se(3) ar(3) ///
stats(N vmean sd, fmt(0 3 3 3 3 "")  ///
labels(`"Observations"' `"Dep Mean"' `"Indep SD"')) ///
star(* 0.1 ** 0.05 *** 0.01) ///
mtitles(`var') ///
keep(c.contestation#c.sec_post c.zanu_control#c.sec_post c.contestation#c.sec_post3 c.zanu_control#c.sec_post3) ///
title("Education Robustness Checks" \label{tab:education_robust}) style(tex) label append


* diff schooling 0-13 (every grade)
est clear
quietly eststo: areg school_full c.zanu_control##c.sec_post c.contestation##c.sec_post i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)
summ school_full
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post
estadd scalar sd = r(sd)

quietly eststo: areg school_full c.zanu_control##c.sec_post3 c.contestation##c.sec_post3 i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)
summ school_full
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post3
estadd scalar sd = r(sd)

esttab est1 est2 ///
using "tables/zimbabwe appendix tables.tex", b(3) se(3) ar(3) ///
stats(N vmean sd, fmt(0 3 3 3 3 "")  ///
labels(`"Observations"' `"Dep Mean"' `"Indep SD"')) ///
star(* 0.1 ** 0.05 *** 0.01) ///
mtitles(`var') ///
keep(c.contestation#c.sec_post c.zanu_control#c.sec_post c.contestation#c.sec_post3 c.zanu_control#c.sec_post3) ///
title("Education Robustness Checks" \label{tab:education_robust}) style(tex) label append


* diff schooling 0-11 (every grade, stop at O-levels)
est clear
quietly eststo: areg school_full2 c.zanu_control##c.sec_post c.contestation##c.sec_post i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)
summ school_full2
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post
estadd scalar sd = r(sd)

quietly eststo: areg school_full2 c.zanu_control##c.sec_post3 c.contestation##c.sec_post3 i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)
summ school_full2
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post3
estadd scalar sd = r(sd)

esttab est1 est2 ///
using "tables/zimbabwe appendix tables.tex", b(3) se(3) ar(3) ///
stats(N vmean sd, fmt(0 3 3 3 3 "")  ///
labels(`"Observations"' `"Dep Mean"' `"Indep SD"')) ///
star(* 0.1 ** 0.05 *** 0.01) ///
mtitles(`var') ///
keep(c.contestation#c.sec_post c.zanu_control#c.sec_post c.contestation#c.sec_post3 c.zanu_control#c.sec_post3) ///
title("Education Robustness Checks" \label{tab:education_robust}) style(tex) label append



* Croke et al coding

est clear
quietly eststo: areg schooling1 c.zanu_control##c.sec_post2 c.contestation##c.sec_post2 i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)
summ schooling1
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post2
estadd scalar sd = r(sd)

quietly eststo: areg schooling2 c.zanu_control##c.sec_post2 c.contestation##c.sec_post2 i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)
summ schooling2
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post2
estadd scalar sd = r(sd)

esttab est1 est2 ///
using "tables/zimbabwe appendix tables.tex", b(3) se(3) ar(3) ///
stats(N vmean sd, fmt(0 3 3 3 3 "")  ///
labels(`"Observations"' `"Dep Mean"' `"Indep SD"')) ///
star(* 0.1 ** 0.05 *** 0.01) ///
mtitles(`var') ///
keep(c.contestation#c.sec_post2 c.zanu_control#c.sec_post2) ///
title("Education Robustness Checks" \label{tab:education_robust}) style(tex) label append


* Interaction

est clear
quietly eststo: areg schooling1 c.zanu_pres##c.sec_post##c.contestation i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)
summ schooling1 if urban == 0 & year_birth >= 1950 & year_birth <= 1971
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post if urban == 0 & year_birth >= 1950 & year_birth <= 1971
estadd scalar sd = r(sd)

quietly eststo: areg schooling1 c.zanu_pres##c.sec_post3##c.contestation i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)
summ schooling1 if urban == 0 & year_birth >= 1950 & year_birth <= 1971
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post3 if urban == 0 & year_birth >= 1950 & year_birth <= 1971
estadd scalar sd = r(sd)


esttab est1 est2 ///
using "tables/zimbabwe appendix tables.tex", b(3) se(3) ar(3) ///
stats(N vmean sd, fmt(0 3 3 3 3 "")  ///
labels(`"Observations"' `"Dep Mean"' `"Indep SD"')) ///
star(* 0.1 ** 0.05 *** 0.01) ///
mtitles(`var') ///
keep(c.sec_post#c.contestation c.zanu_pres#c.sec_post c.zanu_pres#c.sec_post#c.contestation c.sec_post3#c.contestation c.zanu_pres#c.sec_post3 c.zanu_pres#c.sec_post3#c.contestation) ///
title("Interacting ZANU presence with unsecured" \label{tab:education}) style(tex) label append



* shona >= 80%

est clear
eststo: areg schooling1 c.contestation##c.sec_post i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971 & shona_majority == 1, absorb(districtpc) cluster(districtpc)
summ schooling1
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post
estadd scalar sd = r(sd)

quietly eststo: areg schooling1 c.contestation##c.sec_post3 i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971 & shona_majority == 1, absorb(districtpc) cluster(districtpc)
summ schooling1
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post3
estadd scalar sd = r(sd)

esttab est1 est2 ///
using "tables/zimbabwe appendix tables.tex", b(3) se(3) ar(3) ///
stats(N vmean sd, fmt(0 3 3 3 3 "")  ///
labels(`"Observations"' `"Dep Mean"' `"Indep SD"')) ///
star(* 0.1 ** 0.05 *** 0.01) ///
mtitles(`var') ///
keep(c.contestation#c.sec_post c.contestation#c.sec_post3 ) ///
title("Education Robustness Checks (Sample >= 80\% Shona)" \label{tab:education_robust}) style(tex) label append


* no migrate

gen did_not_migrate = .
replace did_not_migrate = 0 if urban == 0 & migrate0 != 0 & migrate0 != 99
replace did_not_migrate = 1 if did_not_migrate == 0 & migrate0 == 11

est clear
quietly eststo: areg schooling1 c.zanu_control##c.sec_post c.contestation##c.sec_post i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971 & did_not_migrate == 1, absorb(districtpc) cluster(districtpc)
summ schooling1
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post
estadd scalar sd = r(sd)

quietly eststo: areg schooling1 c.zanu_control##c.sec_post3 c.contestation##c.sec_post3 i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971 & did_not_migrate == 1, absorb(districtpc) cluster(districtpc)
summ schooling1
estadd scalar vmean = r(mean)
summ c.contestation#c.sec_post3
estadd scalar sd = r(sd)

esttab est1 est2 ///
using "tables/zimbabwe appendix tables.tex", b(3) se(3) ar(3) ///
stats(N vmean sd, fmt(0 3 3 3 3 "")  ///
labels(`"Observations"' `"Dep Mean"' `"Indep SD"')) ///
star(* 0.1 ** 0.05 *** 0.01) ///
mtitles(`var') ///
keep(c.contestation#c.sec_post c.zanu_control#c.sec_post c.contestation#c.sec_post3 c.zanu_control#c.sec_post3) ///
title("Education Robustness Checks (No migrate)" \label{tab:education_robust}) style(tex) label append



**************************
***   PLACEBO CHECKS   ***
**************************

est clear

gen fake_post = 0 if year_birth != .
replace fake_post = 1 if year_birth >= 1955 & year_birth != .
replace fake_post = 5/6 if year_birth == 1954 
replace fake_post = 4/6 if year_birth == 1953 
replace fake_post = 3/6 if year_birth == 1952
replace fake_post = 2/6 if year_birth == 1951
replace fake_post = 1/6 if year_birth == 1950

gen fake_post2 = 0 if year_birth != .
replace fake_post2 = 1 if year_birth >= 1949 & year_birth != .
replace fake_post2 = 5/6 if year_birth == 1948 
replace fake_post2 = 4/6 if year_birth == 1947 
replace fake_post2 = 3/6 if year_birth == 1946
replace fake_post2 = 2/6 if year_birth == 1945
replace fake_post2 = 1/6 if year_birth == 1944

quietly eststo: areg schooling1 c.zanu_control##c.fake_post c.contestation##c.fake_post i.male i.year_birth if urban == 0 & year_birth >= 1940 & year_birth <= 1962, absorb(districtpc) cluster(districtpc)
summ schooling2
estadd scalar vmean = r(mean)
summ c.contestation#c.fake_post
estadd scalar sd = r(sd)

quietly eststo: areg schooling1 c.zanu_control##c.fake_post2 c.contestation##c.fake_post2 i.male i.year_birth if urban == 0 & year_birth >= 1934 & year_birth <= 1956, absorb(districtpc) cluster(districtpc)
summ schooling2
estadd scalar vmean = r(mean)
summ c.contestation#c.fake_post
estadd scalar sd = r(sd)


esttab est1 est2 ///
using "tables/zimbabwe appendix tables.tex", b(3) se(3) ar(3) ///
stats(N vmean sd, fmt(0 3 3 3 3 "")  ///
labels(`"Observations"' `"Dep Mean"' `"Indep SD"')) ///
star(* 0.1 ** 0.05 *** 0.01) ///
mtitles(`var') ///
keep(c.contestation#c.fake_post c.zanu_control#c.fake_post c.contestation#c.fake_post2 c.zanu_control#c.fake_post2) ///
title("Education Placebo Checks" \label{tab:education_placebo}) style(tex) label append


**************************
***   BALANCE CHECKS   ***
**************************

est clear

recode chborn (98/99 = .)
quietly eststo: areg chborn c.zanu_control##c.sec_post c.contestation##c.sec_post i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971 & chborn < 98, absorb(districtpc) cluster(districtpc)

quietly eststo: areg mortnum c.zanu_control##c.sec_post c.contestation##c.sec_post i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)

gen own_home = . if ownership != 1 | ownership != 2
replace own_home = 0 if ownership == 2
replace own_home = 1 if ownership == 1
quietly eststo: areg own_home c.zanu_control##c.sec_post c.contestation##c.sec_post i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)

recode disabled (2=0) (9=.)
quietly eststo: areg disabled c.zanu_control##c.sec_post c.contestation##c.sec_post i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)

quietly eststo: areg did_not_migrate c.zanu_control##c.sec_post c.contestation##c.sec_post i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)

esttab est1 est2 est3 est4 est5 ///
using "tables/zimbabwe appendix tables.tex", b(3) se(3) ar(3) ///
stats(N vmean sd, fmt(0 3 3 3 3 "")  ///
labels(`"Observations"' `"Dep Mean"' `"Indep SD"')) ///
star(* 0.1 ** 0.05 *** 0.01) ///
mtitles(`var') ///
keep(c.contestation#c.sec_post c.zanu_control#c.sec_post) ///
title("Balance Checks" \label{tab:balance}) style(tex) label append

replace marst = . if marst == 9
tab1 marst, gen(marst)

est clear

quietly eststo: areg age c.zanu_control##c.sec_post c.contestation##c.sec_post i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)

foreach var of varlist marst1-marst4 {
	quietly eststo: areg `var' c.zanu_control##c.sec_post c.contestation##c.sec_post i.male i.year_birth if urban == 0 & year_birth >= 1950 & year_birth <= 1971, absorb(districtpc) cluster(districtpc)
}

esttab est1 est2 est3 est4 est5 ///
using "tables/zimbabwe appendix tables.tex", b(3) se(3) ar(3) ///
stats(N vmean sd, fmt(0 3 3 3 3 "")  ///
labels(`"Observations"' `"Dep Mean"' `"Indep SD"')) ///
star(* 0.1 ** 0.05 *** 0.01) ///
mtitles(`var') ///
keep(c.contestation#c.sec_post c.zanu_control#c.sec_post) ///
title("Balance Checks" \label{tab:balance}) style(tex) label append


********************
***   plotting   ***
********************

* 3 area trend

set scheme plotplain
*set scheme plottig

foreach var of varlist schooling1 {
	local vlab : variable label `var'
	
	bys year_birth: egen `var'_zanu = mean(`var') if zanu_control >= 0.25 & contestation != . & urban == 0
	bys year_birth: egen `var'_contest = mean(`var') if contestation >= 0.25 & contestation != . & urban == 0 
	bys year_birth: egen `var'_zapu = mean(`var') if zapu_control >= 0.25 & contestation != . & urban == 0 
	
	twoway (scatter `var'_contest year_birth if year_birth >= 1950 & year_birth <= 1971, color(black) msize(vsmall) symbol(circle)) ///
		(scatter `var'_zapu year_birth if year_birth >= 1950 & year_birth <= 1971, color(gs12) msize(vsmall) symbol(circle)) ///
		(scatter `var'_zanu year_birth if year_birth >= 1950 & year_birth <= 1971, color(gs8) msize(vsmall) symbol(circle)) ///
		(lpoly `var'_contest year_birth if year_birth >= 1950 & year_birth <= 1963, bwidth(1) lcolor(black) lpattern(solid)) ///
		(lpoly `var'_zapu year_birth if year_birth >= 1950 & year_birth <= 1963, bwidth(1) lcolor(gs12) lpattern(solid)) ///
		(lpoly `var'_zanu year_birth if year_birth >= 1950 & year_birth <= 1963, bwidth(1) lcolor(gs8) lpattern(solid)) ///
		(lpoly `var'_contest year_birth if year_birth >= 1964 & year_birth <= 1971, bwidth(1) lcolor(black) lpattern(solid)) ///
		(lpoly `var'_zapu year_birth if year_birth >= 1964 & year_birth <= 1971, bwidth(1) lcolor(gs12) lpattern(solid)) ///
		(lpoly `var'_zanu year_birth if year_birth >= 1964 & year_birth <= 1971, bwidth(1) lcolor(gs8) lpattern(solid)), ///
		legend(lab(4 "Unsecured areas") lab(5 "ZAPU strongholds") lab(6 "ZANU strongholds") order(4 6 5) size(medsmall) ring(0) position(5)) ///
		xtitle("Year of birth", size(medium)) ytitle("Education", size(medium)) title("Education Gains in Unsecured areas, ZANU Stronghold, and ZAPU Stronghold") ///
		xline(1960 1969, lcolor(gs13) lpattern(shortdash)) xline(1964, lcolor(black) lpattern(shortdash)) xlabel(1950(5)1972)
 	drop *_contest *_zapu *_zanu
	local y `"`y' "`var'""'  
}



est clear

keep if urban == 0 & year_birth >= 1950 & year_birth <= 1971
estpost summ zanu_control contestation zapu_control schooling1 schooling2 school_full school_full2 sec_post sec_post2 male did_not_migrate chborn mortnum own_home disabled


esttab using "tables/zimbabwe summary statistics.tex", replace cells("count mean(fmt(3)) sd(fmt(3)) min max") label nomtitle noobs nonumber



